<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Select2 下拉 - Easy Frame</title>
    <meta name="description" content="Updates and statistics">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <!--str:::全局css -->
    <link href="/assets/plugins/global/plugins.bundle.css" rel="stylesheet" type="text/css"/>
    <link href="/assets/css/demo1/style.bundle.css" rel="stylesheet" type="text/css"/>
    <!--end::全局css -->

    <link rel="shortcut icon" href="/assets/media/logos/favicon.ico"/>
</head>
<body class="e-page--loading">
<div class="e-content">
    <div class="row">
        <div class="col">
            <div class="alert alert-light alert-elevate fade show" role="alert">
                <div class="alert-icon"><i class="flaticon-warning e-font-brand"></i></div>
                <div class="alert-text">
                    基于<code>Select</code>插件，此插件功能与Bootstrap Select类似，与Bootstrap Select相比多出异步搜索和自定义option功能
                    <a class="e-link e-font-bold" href="https://select2.org/getting-started/basic-usage" target="_blank">官方文档</a>
                    <a class="e-link e-font-bold" href="https://github.com/select2/select2" target="_blank">Github</a>
                </div>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="col-md-6">
            <form class="e-form">
                <div class="card">
                    <div class="card-head">
                        <div class="card-head-label">
                            <h3 class="card-head-title">
                                基础
                            </h3>
                        </div>
                    </div>
                    <div class="card-body">
                        <form class="e-form">
                            <div class="e-section">
                                <div class="e-section-title">默认</div>
                                <div class="e-section-info">
                                    框架中默认会将<code>.select2-picker</code>当做下拉插件初始化
                                </div>
                                <div class="e-section-content">
                                    <div class="form-group row">
                                        <label class="col-form-label col-4">默认：</label>
                                        <div class="col-7">
                                            <select class="form-control select2-picker">
                                                <option value="1" selected>option 1</option>
                                                <option value="2">option 2</option>
                                                <option value="3">option 3</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label class="col-form-label col-4">分组：</label>
                                        <div class="col-7">
                                            <select class="form-control select2-picker">
                                                <optgroup label="分组1">
                                                    <option value="1" selected>option 1-1</option>
                                                    <option value="2">option 1-2</option>
                                                    <option value="3">option 1-3</option>
                                                </optgroup>
                                                <optgroup label="分组2">
                                                    <option value="1">option 2-1</option>
                                                    <option value="2">option 2-2</option>
                                                    <option value="3">option 2-3</option>
                                                </optgroup>
                                            </select>
                                            <span class="form-text text-muted">将<code>option</code>放到<code>optgroup</code>中可实现<code>option</code>分组</span>
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label class="col-form-label col-4">多选：</label>
                                        <div class="col-7">
                                            <select class="form-control select2-picker" multiple>
                                                <option value="1" selected>option 1</option>
                                                <option value="2" selected>option 2</option>
                                                <option value="3">option 3</option>
                                            </select>
                                            <span class="form-text text-muted">在<code>select.select2-picker</code>上添加<code>[multiple]</code>属性启用多选</span>
                                        </div>
                                    </div>
                                    <div class="e-separator e-separator--dashed"></div>
                                    <div class="e-section-title">搜索</div>
                                    <div class="form-group row">
                                        <label class="col-form-label col-4">搜索：</label>
                                        <div class="col-7">
                                            <select class="form-control select2-picker" data-live-search="true" multiple>
                                                <option value="1" selected>option 1</option>
                                                <option value="2">option 2</option>
                                                <option value="3">option 3</option>
                                            </select>
                                            <span class="form-text text-muted">在<code>select.select2-picker</code>上添加<code>[data-live-search="true"]</code>属性启用搜索</span>
                                        </div>
                                    </div>
                                    <div class="e-separator e-separator--dashed"></div>
                                    <div class="e-section-title">验证</div>
                                    <div class="form-group row">
                                        <label class="col-form-label col-4">最多选2个：</label>
                                        <div class="col-7">
                                            <select class="form-control select2-picker" data-live-search="true" multiple data-max-options="2">
                                                <option value="1" selected>option 1</option>
                                                <option value="2">option 2</option>
                                                <option value="3">option 3</option>
                                            </select>
                                            <span class="form-text text-muted">在<code>select.select2-picker</code>上添加<code>[data-max-options="2"]</code>属性设置最大选中数</span>
                                        </div>
                                    </div>
                                </div>
                                <div class="e-separator e-separator--dashed"></div>
                                <div class="e-section-title">文本</div>
                                <div class="e-section-content">
                                    <div class="form-group row">
                                        <label class="col-form-label col-4">提示文字：</label>
                                        <div class="col-7">
                                            <select class="form-control select2-picker" multiple title="每个分组最多选择2个">
                                                <optgroup label="分组1" data-max-options="2">
                                                    <option value="1">option 1-1</option>
                                                    <option value="2">option 1-2</option>
                                                    <option value="3">option 1-3</option>
                                                </optgroup>
                                                <optgroup label="分组2" data-max-options="2">
                                                    <option value="1">option 2-1</option>
                                                    <option value="2">option 2-2</option>
                                                    <option value="3">option 2-3</option>
                                                </optgroup>
                                            </select>
                                            <span class="form-text text-muted">在<code>select.select2-picker</code>上添加<code>[title="每个分组最多选择2个"]</code>属性设置提示文字</span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </form>
        </div>
        <div class="col-md-6">
            <form class="e-form">
                <div class="card">
                    <div class="card-head">
                        <div class="card-head-label">
                            <h3 class="card-head-title">
                                高级
                            </h3>
                        </div>
                    </div>
                    <div class="card-body">
                        <form class="e-form">
                            <div class="e-section">
                                <div class="e-section-title">Disabled</div>
                                <div class="e-section-content">
                                    <div class="form-group row">
                                        <label class="col-form-label col-4">禁用选项：</label>
                                        <div class="col-7">
                                            <select class="form-control select2-picker" multiple>
                                                <option value="1" disabled>option 1</option>
                                                <option value="2">option 2</option>
                                                <option value="3">option 3</option>
                                            </select>
                                            <span class="form-text text-muted">在<code>select.select2-picker option</code>上添加<code>[disabled]</code>属性禁用选项</span>
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label class="col-form-label col-4">禁用组：</label>
                                        <div class="col-7">
                                            <select class="form-control select2-picker" multiple>
                                                <optgroup label="分组1" data-max-options="2" disabled>
                                                    <option value="1">option 1-1</option>
                                                    <option value="2">option 1-2</option>
                                                    <option value="3">option 1-3</option>
                                                </optgroup>
                                                <optgroup label="分组2" data-max-options="2">
                                                    <option value="1">option 2-1</option>
                                                    <option value="2">option 2-2</option>
                                                    <option value="3">option 2-3</option>
                                                </optgroup>
                                            </select>
                                            <span class="form-text text-muted">在<code>select.select2-picker > optgroup</code>上添加<code>[disabled]</code>属性禁用分组</span>
                                        </div>
                                    </div>
                                </div>
                                <div class="e-separator e-separator--dashed"></div>
                                <div class="e-section-title">宽度</div>
                                <div class="e-section-content">
                                    <div class="form-group row">
                                        <label class="col-form-label col-4">自动：</label>
                                        <div class="col-7">
                                            <select class="form-control select2-picker" multiple title="Auto">
                                                <optgroup label="分组1" data-max-options="2">
                                                    <option value="1">option 1-1</option>
                                                    <option value="2">option 1-2</option>
                                                    <option value="3">option 1-3</option>
                                                </optgroup>
                                                <optgroup label="分组2" data-max-options="2">
                                                    <option value="1">option 2-1</option>
                                                    <option value="2">option 2-2</option>
                                                    <option value="3">option 2-3</option>
                                                </optgroup>
                                            </select>
                                            <span class="form-text text-muted">在<code>select.select2-picker</code>上添加<code>[data-width=""]</code>属性设置宽度</span>
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label class="col-form-label col-4">fit：</label>
                                        <div class="col-7">
                                            <select class="form-control select2-picker" multiple title="fit" data-width="fit">
                                                <optgroup label="分组1" data-max-options="2">
                                                    <option value="1" selected>option 1-1</option>
                                                    <option value="2">option 1-2</option>
                                                    <option value="3">option 1-3</option>
                                                </optgroup>
                                                <optgroup label="分组2" data-max-options="2">
                                                    <option value="1">option 2-1</option>
                                                    <option value="2">option 2-2</option>
                                                    <option value="3">option 2-3</option>
                                                </optgroup>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label class="col-form-label col-4">150px：</label>
                                        <div class="col-7">
                                            <select class="form-control select2-picker" multiple title="150px" data-width="150px">
                                                <optgroup label="分组1" data-max-options="2">
                                                    <option value="1">option 1-1</option>
                                                    <option value="2">option 1-2</option>
                                                    <option value="3">option 1-3</option>
                                                </optgroup>
                                                <optgroup label="分组2" data-max-options="2">
                                                    <option value="1">option 2-1</option>
                                                    <option value="2">option 2-2</option>
                                                    <option value="3">option 2-3</option>
                                                </optgroup>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label class="col-form-label col-4">50%：</label>
                                        <div class="col-7">
                                            <select class="form-control select2-picker" multiple title="50%" data-width="50%">
                                                <optgroup label="分组1" data-max-options="2">
                                                    <option value="1">option 1-1</option>
                                                    <option value="2">option 1-2</option>
                                                    <option value="3">option 1-3</option>
                                                </optgroup>
                                                <optgroup label="分组2" data-max-options="2">
                                                    <option value="1">option 2-1</option>
                                                    <option value="2">option 2-2</option>
                                                    <option value="3">option 2-3</option>
                                                </optgroup>
                                            </select>
                                        </div>
                                    </div>

                                </div>
                                <div class="e-separator e-separator--dashed"></div>
                                <div class="e-section-title">标签</div>
                                <div class="e-section-content">
                                    <div class="form-group row">
                                        <label class="col-form-label col-4">添加标签：</label>
                                        <div class="col-7">
                                            <select class="form-control select2-picker" multiple data-tags="true">
                                                <option value="1" selected>option 1</option>
                                                <option value="2">option 2</option>
                                                <option value="3">option 3</option>
                                            </select>
                                            <span class="form-text text-muted">在<code>select.select2-picker</code>上添加<code>[data-tags="true"]</code>属性开启添加自定义标签</span>
                                        </div>
                                    </div>
                                </div>


                            </div>
                        </form>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<!--str:: 全局js -->
<script src="/assets/plugins/global/plugins.bundle.js"></script>
<script src="/assets/js/demo1/scripts.bundle.js"></script>
<!--end:: 全局js -->
</body>
</html>